program Table;

{$APPTYPE CONSOLE}
var
x, y, a, b : array of real;
n, m : integer;
fin : textfile;
i : integer;
s, sq, leg : real;
xo, yo : real;
begin
  assignfile(fin, 'input.txt');
  reset(fin);
  read(n, m);
  setlength(x, n);
  setlength(y, n);
  setlength(a, m);
  setlength(b, m);
  if n>m then
  begin
    for i:=1 to n do
    begin
      if i>m then
      begin
        readln(x[i], y[i]);
      end
      else
      begin
      readln(x[i], y[i], a[i], b[i]);
      end;
    end;
  end
  else
  begin
    for i:=1 to m do
    begin
      if i>n then
      begin
        readln(a[i], b[i]);
      end
      else
      begin
        readln(x[i], y[i], a[i], b[i]);
      end;
    end;
  end;

  leg := y[1]-b[1];
  xo :=0;
  yo :=0;
  for i:=1 to n do
  begin
    xo := xo+x[i];
    yo := yo+y[i];
  end;
  xo := xo/n;
  yo := yo/n;

  yo := yo-leg;
  s := 0;
  for i:=1 to m-2 do
  begin
    s := x[i]*y[i+1]-x[i+1]*y[i];
  end;
  s := s + x[m]*y[1]-x[1]*y[m];
  sq := 0;
  sq := s;

  for i:=1 to m-1 do
  begin
    s := s+xo*y[i]-x[i]*yo+x[i]*y[i+1]-x[i+1]*y[i]+x[i+1]*yo-xo*x[i+1];
  end;
  s := s+xo*y[1]-x[1]*yo+x[1]*y[m]-x[m]*y[1]+x[m]*yo-xo*x[m];
  if (sq=2*s) then writeln('yes');
  if (sq<>2*s) then writeln('no');


end.
 